<template>
    <div class="icons">
        <swiper :options="swiperOption">
            <swiper-slide>
                <div class="icon" v-for="item of iconList" :key="item.id">
                    <div class="icon-img">
                        <img class="icon-img-content" :src="item.imgUrl" alt="">
                    </div>
                    <p class="icon-desc">{{item.desc}}</p>
                </div>
            </swiper-slide>
            <swiper-slide>
                <div class="icon">
                    <div class="icon-img">
                        <img class="icon-img-content" src="../../../assets/icon1.png" alt="">
                    </div>
                    <p class="icon-desc">热门景点</p>
                </div>
            </swiper-slide>
        </swiper>
    </div>
</template>
<script>
    export default {
        name: 'HomeIcons',
        props: {
            iconList: Array
        },
        data() {
            return {
                swiperOption: {
                    
                }
            }
        }
    }
</script>

<style lang='stylus' scoped>
@import '../../../assets/styles/varibles.styl'

    .icons
        height 0
        padding-bottom 50%
        overflow hidden
        margin .1rem
        .icon
            height 0
            width 25%
            padding-bottom 25%
            float left
            overflow hidden
            position relative
            .icon-img
                position absolute
                top 0
                bottom .44rem
                left 0
                right 0
                padding .1rem
                .icon-img-content
                    height 100%
                    display block
                    margin 0 auto
            .icon-desc
                elipsls()
                position absolute
                bottom 0
                left 0
                right 0
                text-align center
                height .4rem
                line-height .4rem
                color $darkTextColor
</style>